keycode
A Rust crate for translating keycodes based on Chrome's mapping of keys.
Easily convert, generate, listen for, or map keycodes for Linux, Windows, Mac,
USB, and browsers! Includes a struct
to manage the state of pressed keys and
generate USB HID reports. Can be used for #![no_std]
crates.
Source Data
Source of keycodes data:
- Repo: https://chromium.googlesource.com/chromium/src.git
- File: https://chromium.googlesource.com/chromium/src.git/+/master/ui/events/keycodes/dom/keycode_converter_data.inc
- Git commit:
2b6022954b9fb600f15e08002a148187f4f986da
How to update source file:
|
Examples
Get a key mapping
use ;
// Check the USB HID value of the "a" key
Generate a USB HID report
use ;
// Press and release the "A" key
Supported Rust Versions
Requires Rust 1.34.0 or newer due to use of TryFrom.